@extends('web.layout')

@section('content')
    <div class="layui-container fly-marginTop fly-user-main">
        @include('web.user.nav')

        <div class="fly-panel fly-panel-user" pad20>
            <div class="layui-tab layui-tab-brief" lay-filter="user">
                <ul class="layui-tab-title" id="LAY_mine">
                    <li class="layui-this" lay-id="info">发布广告</li>
                    <li lay-id="withdraw-log">广告记录</li>
                </ul>
                <div class="layui-tab-content" style="padding: 20px 0;">
                    <div class="layui-form layui-form-pane layui-tab-item layui-show">
                        <form method="post" action="{{ url('/user-pubadv') }}">


                            <div class="layui-form-item">
                                <label for="L_alipay_name" disabled class="layui-form-label">展示单价</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="L_alipay_name" name="money" autocomplete="off" value="3" class="layui-input layui-disabled" disabled>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="L_amount" class="layui-form-label">展示天数</label>
                                <div class="layui-input-inline">
                                    <input type="number" id="L_amount" name="day" required lay-verify="required" placeholder="请输入展示天数" autocomplete="off" value="30" class="layui-input">
                                </div>
                                <div class="layui-form-mid">&nbsp; &nbsp;<span class="star-red">收费3元/天，每30天为1个周期。审核通过后开始计算天数</span></div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label for="L_union_desc" class="layui-form-label">广告内容</label>
                                <div class="layui-input-block">
                                    <textarea placeholder="请输入广告内容" id="L_union_desc"  name="text" autocomplete="off" class="layui-textarea" style="height: 100px;"></textarea>
                                </div>
                            </div>



                            <div class="layui-form-item">
                                <button class="layui-btn recharge-btn" key="set-mine" lay-filter="*" lay-submit>发布广告</button>
                            </div>
                        </form>
                    </div>
                    <div class="layui-form layui-form-pane layui-tab-item">
                        <table class="layui-hide" id="table-list"></table>
                    </div>
                </div>

            </div>
        </div>
    </div>
@endsection

@section('scripts')
    <script>
        layui.use(['form','table'], function(){
            var $ = layui.$
                ,form = layui.form
                ,layer = layui.layer
                ,table = layui.table;

            table.render({
                elem: '#table-list'
                ,url: "{{ url('/user-myadvlist') }}"
                ,cellMinWidth: 100
                ,cols: [[
                    {field:'text', width:'65%', title: '广告内容'}
                    ,{field:'end_date', title: '结束时间'}
                    ,{field:'status', title: '状态'}
                    /*,{field:'poundage', title: '手续费'}
                    ,{field:'status_name', title: '状态',templet:function(d){
                            return '<span class="layui-badge '+d.status_color+'">'+d.status_name+'</span>';
                        }}
                    ,{field:'updated_at', title: '更新时间'}*/
                ]]
                ,page: {
                    layout: ['prev', 'page', 'next']
                }
            });

        });
    </script>
@endsection